package com.isoft.hospital.dao;


import com.isoft.hospital.entity.Department;
import com.isoft.hospital.entity.Medicine;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface DepartmentDao {
    @Select("select * from department")
    List<Department> selectAll();
    @Insert("insert into department(d_id,d_name,d_des) values(#{d_id},#{d_name},#{d_des})")
    int insert(Department department); //与Impl关联
    @Delete("delete from department where d_id=#{d_id}")
    int delete(int d_id);
    @Update("update  department set d_name=#{d_name},d_des=#{d_des} where d_id=#{d_id}")
    int update(Department department);
    @Select("select d_id,d_name d_des from department where d_id=#{d_id} ")
    Department findById(@Param("d_id") int d_id);
}
